package yesjava;

import java.util.Scanner;

//输入一串字母,不区分大小写统计输出
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一串字母");
        String youInput = scanner.nextLine().trim().toLowerCase();
        int[] count = new int[26];
        char[] chars = youInput.toCharArray();
        //统计
        for (int i = 0; i < chars.length; i++) {
            char c = chars[i];
            int index = c - 'a';// 'b' - 'a'
            count[index] = count[index] + 1;
        }

//        输出结果
        for (int i = 0; i < count.length; i++) {
            char c = (char) ('a'+i);
            int countOfC = count[i];
            if(countOfC!=0){
                System.out.println(c+":"+countOfC);
            }
        }
    }
}